import { Redirect } from "react-router-dom";

import CQDiscover from '@/pages/discover';
import CQRecommend from "../pages/discover/c-pages/recommend";
import CQRanking from "../pages/discover/c-pages/ranking";
import CQSongs from "../pages/discover/c-pages/songs";
import CQDjradio from "../pages/discover/c-pages/djradio";
import CQArtist from "../pages/discover/c-pages/artist";
import CQAlbum from "../pages/discover/c-pages/album";

import CQMine from '@/pages/mine';
import CQFriend from '@/pages/friend';


const routes = [
  {
    path: '/',
    exact: true,
    render: () => (
      <Redirect to="/discover"/>
    )
  },
  {
    path: '/discover',
    component: CQDiscover,
    routes: [
      {
        path: "/discover",
        exact: true,
        render: () => (
          <Redirect to="/discover/recommend"/>
        )
      },
      {
        path: "/discover/recommend",
        component: CQRecommend
      },
      {
        path: "/discover/ranking",
        component: CQRanking
      },
      {
        path: "/discover/songs",
        component: CQSongs
      },
      {
        path: "/discover/djradio",
        exact: true,
        component: CQDjradio
      },
      {
        path: "/discover/artist",
        component: CQArtist
      },
      {
        path: "/discover/album",
        component: CQAlbum
      },
      {
        path: "/discover/songs",
        component: CQSongs
      }
    ]
  },
  {
    path: '/mine',
    component: CQMine
  },
  {
    path: '/friend',
    component: CQFriend
  },
];
export default routes;

